require(['./config'], () => {
  require([ 'template','swiper','request',  'header',   'footer'], (template, Swiper, ) => {
      class Index {
          constructor() {
              // console.log(Swiper)
              this.getCategory()
              this.getGraphic()              
              this.banner();
             
          }

          getCategory () {
            // 颗粒度
            $.get('/libs/json/homeCategory.json', resp => {
              this.renderCategory(resp)
            })
          }
    
          renderCategory (list) {
            const html = template('categoryTemplate', { list })
            console.log(html)
            $('#categoryList').html(html)
           
          }

          getGraphic () {
            $.get('/libs/json/graphic tools.json', resp => {
              this.renderGraphic(resp)
            })
          }
    
          renderGraphic (list) {
            const html = template('GraphicTemplate', { list })
            console.log(html)
            $('#GraphicList').html(html)
           
          }

          banner() {

            var mySwiper = new Swiper('.swiper-container', {
              autoplay: 3000, //可选选项，自动滑动
              // direction : 'vertical', // 垂直切换
              speed: 1000,
              pagination: '.swiper-pagination',
              prevButton: '.swiper-button-prev',
              nextButton: '.swiper-button-next',
              loop: true,
             
          })
          }
         
      }
      new Index();
  })


})
